﻿Imports Microsoft.VisualBasic

Public Class VersionCRN

    Public Function GetVersion() As Version

        Dim adapter As VersionDSTableAdapters.VersionTableAdapter = New VersionDSTableAdapters.VersionTableAdapter()
        Dim tabla As VersionDS.VersionDataTable = adapter.GetVersion()
        If tabla Is Nothing Or tabla.Count <= 0 Then
            Throw New Exception("No se pudo obtener la version de la Base de Datos")
        End If

        Dim row As VersionDS.VersionRow = tabla(0)

        Dim version As Version = New Version(row.versionMayor, row.versionMenor, row.release)

        Return version

    End Function

End Class
